from core.basehandler import BaseHandler
from core.room import Room
from items.knife import Knife
from core.action import Action
from items.lighter import Lighter
from core.player import Player
from core.support import get_game

class Sea2Lost(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        #add inventory items
        game = get_game()
        game.player.add_item(Knife())
        game.player.add_item(Lighter())

        # build list of actions
        self.add_action(Next)    
        
    # return description of room.
    def get_description(self):
        return "This morning was the third sunrise you've seen while lost at sea. The rogue wave that swamped your boat during your transit home seemed like it was sent by Poseidon himself. You barely had time to grab your backpack and jump overboard before the boat was pulled to Davey Jones' Locker.  Fortunately, your liferaft inflated and floated to the surface.  There is not much in the boat but you do see a knife and lighter laying on the raft floor. Click continue."
        
    # return image of room
    def get_image(self):
        return 'sea2lost_pic.jpg'
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Sea2Lost

class Sea2LostHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Sea2Lost
# define actions for this room

class Next(Action):
    def __init__(self):
        Action.__init__(self, "Next")    # do basic initialization for every action
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea3bag'
    
    def get_description(self):
        return "Continue"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"